import Layout from '@/layout'

export const walleRouter = [
  {
    path: '/walle/space',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'WalleSpace',
        component: () => import('@/views/walle/space'),
        name: 'Icons',
        meta: { title: '空间管理', icon: 'el-icon-star-off', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
      }
    ]
  },
  {
    path: '/walle/user',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'WalleUser',
        meta: { title: '用户管理', icon: 'el-icon-user', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
        component: () => import('@/views/walle/user')
      }
    ]
  },
  {
    path: '/walle/project',
    redirect: 'noRedirect',
    name: 'WalleProjects',
    meta: { title: '项目中心', icon: 'el-icon-shopping-bag-1', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
    component: Layout,
    children: [
      {
          path: '/walle/environment/index',
          name: 'WalleEnvironment',
          meta: { title: '环境管理', icon: 'el-icon-office-building', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
          component: () => import('@/views/walle/environment')
      },
      {
          path: '/walle/server/index',
          name: 'WalleServer',
          meta: { title: '服务器管理', icon: 'el-icon-refrigerator', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
          component: () => import('@/views/walle/server')
      },
      {
        path: '/walle/project/index',
        name: 'WalleProject',
        meta: { title: '项目管理', icon: 'el-icon-shopping-bag-2', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
        component: () => import('@/views/walle/project/index'),
        children: [
          {
            path: '/walle/project/member',
            name: 'MemberProject',
            component: (resolve) => require([`@/views/walle/project/member.vue`], resolve),
            hidden: true,
            meta: { title: '成员管理', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
            children: []
          }, 
          {
            path: '/walle/project/create',
            name: 'CreateProject',
            component: (resolve) => require([`@/views/walle/project/editproject.vue`], resolve),
            hidden: true,
            meta: { title: '创建', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
            children: []
          }, 
          {
            path: '/walle/project/update',
            name: 'UpdateProject',
            component: (resolve) => require([`@/views/walle/project/editproject.vue`], resolve),
            hidden: true,
            meta: { title: '编辑', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
            children: []
          }, 
          {
            path: '/walle/project/view',
            name: 'ViewProject',
            component: (resolve) => require([`@/views/walle/project/editproject.vue`], resolve),
            hidden: true,
            meta: { title: '查看', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
            children: []
          }, 
          {
            path: '/walle/project/check',
            name: 'CheckProject',
            component: (resolve) => require([`@/views/walle/project/check.vue`], resolve),
            hidden: true,
            meta: { title: '检测报告', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
            children: []
          }
        ]
      }
    ]
  },
  {
    path: '/walle/deploy',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'WalleDeploy',
        meta: { title: '部署管理', icon: 'el-icon-setting', roles: ['OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
        component: () => import('@/views/walle/deploy/index'),
        children: [
          {
            path: '/walle/deploy/create',
            name: 'CreateTask',
            component: (resolve) => require([`@/views/walle/deploy/create.vue`], resolve),
            hidden: true,
            meta: { title: '新建上线单', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
            children: []
          },
          {
            path: '/walle/deploy/view',
            name: 'ViewTask',
            component: (resolve) => require([`@/views/walle/deploy/view.vue`], resolve),
            hidden: true,
            meta: { title: '查看上线单', roles: ['SUPER', 'OWNER', 'MASTER', 'DEVELOPER', 'REPORTER'] },
            children: []
          }
        ]
      }
    ]
  }
]